Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(search): process [C-h] and [C-?] as representations of backspace #1857

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

akinomyoga
Copy link
Contributor

Fixes #1753

As discussed in #1753, I think this should ideally be fixed in crossterm, but there are general limitations by the terminal protocols and the support by the terminals in the market. I here instead suggest solving this at Atuin's side. The description is found in the commit message and also in a code comment.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

In the conventional terminal protocol, Backspace can be transmitted as
the code \x08 or \x7F depending on the terminal.  Ctrl+Backspace can
also be transmitted as the code \x08 or \x7F.  These overlap with the
code for Ctrl+H and Ctrl+?.  The crossterm library does not try to
handle these terminal dependencies (probably because it is hard to
resolve it perfectly).  To provide a consistent experience among
terminals, we assign to C-h and C-? the same feature as backspace.

Note: The crossterm seems to produce Ctrl+Backspace only in the
extended keyboard protocol, so we can trust crossterm particularly for
Ctrl+Backspace.  For this reason, we keep the feature of removing a
backward word by Ctrl+Backspace.

atuinsh#1753
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me. Thank you for the fix!

@ellie ellie merged commit 0d3741f into atuinsh:main Mar 11, 2024
16 checks passed
@akinomyoga akinomyoga deleted the search-backspace branch March 15, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In Atuin UI interprets backspace as literal ^h
2 participants